{include file='_header'}
<script type="text/javascript" src="__STATIC__/js/lib/moment.js"></script>
<link rel="stylesheet" href="__STATIC__/components/datetimepicker/jquery.datetimepicker.css">
<link rel="stylesheet" href="__STATIC__/components/daterangepicker/daterangepicker.css">
<div class="page-header">
    当前位置：<span class="text-primary">{$applytitle}提现申请</span>
</div>
<div class="page-content">
    <form action="" method="get" class="form-horizontal table-search" role="form">
        <div class="page-toolbar m-b-sm m-t-sm">
            <div class="col-sm-6">
                <div class='input-group input-group-sm'   >
                   <div class="input-group-select">
                       <select name='timetype'   class='form-control  input-sm select-md' >
                           <option value=''>不按时间</option>
                           {if $status>=1}<option value='applytime' {if $timetype=='applytime'}selected{/if}>申请时间</option>{/if}
                           {if $status>=2}<option value='checktime' {if $timetype=='checktime'}selected{/if}>审核时间</option>{/if}
                           {if $status>=3}<option value='paytime' {if $timetype=='paytime'}selected{/if}>打款时间</option>{/if}
                       </select>
                   </div>
                    {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
                </div>
            </div>
            <div class="col-sm-6 pull-right">
                <div class="input-group">
                    <div class="input-group-select">
                        <select name='searchfield'  class='form-control  input-sm select-md'   style="width:110px;"  >
                            <option value='member' {if $searchfield=='member'}selected{/if}>商户信息</option>
                            <option value='applyno' {if $searchfield=='applyno'}selected{/if}>提现单号</option>
                        </select>
                    </div>
                    <input type="text" class="form-control input-sm"  name="keyword" value="{$keyword}" placeholder="请输入关键词"/>
                    <span class="input-group-btn">
                        <button class="btn btn-primary" type="submit"> 搜索</button>
                        <button type="submit" name="export" value="1" class="btn btn-success">导出</button>
                    </span>
                </div>
            </div>
        </div>
    </form>

    <?php $col=8; ?>
    {if count($list) <= 0}
    <div class='panel panel-default'>
        <div class='panel-body' style='text-align: center;padding:30px;'>
            暂时没有任何申请!
        </div>
    </div>
    {else}
    <table class="table table-hover table-responsive">
        <thead class="navbar-inner">
        <tr>
            <!--<th style="width:25px;"><input type='checkbox' /></th>-->
            <th style="width:200px;">提现单号</th>
            <th>商户信息</th>
            <th>申请金额<br>抽成后金额</th>
            {if $status > 1}
            <?php $col++; ?>
            <th>通过申请金额<br>抽成后金额</th>
            {/if}
            {if $status == 3}
            <?php $col++; ?>
            <th>实际打款金额</th>
            {/if}
            <th>抽成比例</th>
            <th>申请订单个数{if $status > 1}<br>通过申请订单个数{/if}</th>
            <th >提现方式</th>
            {if $_W['routes']=='merch.check.status2'}
            <?php $col++; ?>
            <th>最终打款</th>
            {/if}
            <th>申请时间</th>
            <th style="width:40px;">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach name='list' item='row'}
        <tr>
            <!--<td style="position: relative; "><input type='checkbox'   value="{$row['id']}"/></td>-->
            <td>{$row['applyno']}</td>
            <td>{$row['realname']}<br/>{$row['mobile']}</td>
            <td>{$row['realprice']}<br>{$row['realpricerate']}</td>
            {if $status > 1}
            <td>{$row['passrealprice']}<br>{$row['passrealpricerate']}</td>
            {/if}
            {if $status == 3}
            <td>{$row['finalprice']}</td>
            {/if}
            <td>{$row['payrate']}%</td>
            <td>{$row['ordernum']}{if $status > 1}<br>{$row['passordernum']}{/if}</td>
            <td >
                {if empty($row['applytype'])}
                <i class="icow icow-weixin text-success"></i>微信钱包
                {elseif $row['applytype']=='2'}
                <i class="icow icow-weixin text-primary"></i>支付宝
                {elseif $row['applytype']=='3'}
                <i class="icow icow-icon text-warning"></i>银行卡
                {/if}
            </td>
            {if $_W['routes']=='merch.check.status2'}
            <td>{$row['finalprice']}</td>
            {/if}
            <td>
                {:date('Y-m-d',$row['applytime'])}<br/>{:date('H:i',$row['applytime'])}
            </td>
            <td style="overflow:visible;">
                    <a class='btn btn-default btn-sm btn-op btn-operation' href="{:url('admin/merch/checkdetail',array('id' => $row['id'], 'status' => $status))}">
                        <span data-toggle="tooltip" data-placement="top" title="" data-original-title="查看详情">
                            <i class='icow icow-chakan-copy'></i>
                       </span>
                    </a>
                {if $row['status'] != '2'}
                    <!--<a data-toggle='ajaxRemove' href="{:url('admin/merch/checkdelete',array('id' => $row['id']));}" class="btn btn-danger btn-sm" data-confirm='确认要删除此结账单?'>删除</a>-->
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
        <tfoot>
            <tr>
                <td class="text-right" colspan="{$col}">
                    {$pager}
                </td>
            </tr>
        </tfoot>
    </table>
    {/if}
</div>
{include file='_footer'}